<template>
  <swiper>
    <swiper-item v-for="item in banners" :key="item.label" >
      <a :href="item.link">
        <img :src="item.image" alt="" @load="loaded">
      </a>
    </swiper-item>
  </swiper>
</template>

<script>

  import {Swiper,SwiperItem} from 'components/common/swiper'


export default {
  name: "HomeSwiper",
  data(){
    return{
      isload:false,
    }
  },
  props:{
    banners:{
      type:Array,
      default(){
        return []
      }
    }
  },
  components:{
    Swiper,
    SwiperItem
  },
  created() {
    console.log('swiper created');
  },
  mounted() {
    console.log('swiper mounted');
  },
  methods:{
    loaded(){
      if(!this.isload){
        this.$emit('loadimg')
        console.log('siu!');
        this.isload = true
      }

    }
  }


}
</script>

<style scoped>

</style>
